package com.googlecode.stemwijzer.shared.data;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import com.googlecode.stemwijzer.shared.model.IsAnswer;
import com.googlecode.stemwijzer.shared.model.IsQuestion;
import com.googlecode.stemwijzer.shared.model.impl.Answer;
import com.googlecode.stemwijzer.shared.model.impl.Question;
import com.googlecode.stemwijzer.shared.model.impl.QuestionnaireResult;

@SuppressWarnings("serial")
public final class QuestionnaireData {

	public static final IsQuestion IMMIGRATION = new Question(
			"Nederland moet immigranten van buiten de EU selectiever toelaten");
	public static final IsQuestion EDUCATION = new Question("Schoolboeken moeten gratis zijn");
	public static final IsQuestion SOCIAL_SECURITY = new Question(
			"Rijke ouderen moeten in de toekomst meer bijdragen aan de AOW dan arme ouderen");
	public static final IsQuestion EMPLOYMENT = new Question("Het moet eenvoudiger worden werknemers te ontslaan");
	public static final IsQuestion HOUSING = new Question(
			"De hypotheekrenteaftrek voor de hoogste inkomens moet worden beperkt");

	private static final List<IsQuestion> availableQuestions = new ArrayList<IsQuestion>() {
		{
			add(IMMIGRATION);
			add(EDUCATION);
			add(SOCIAL_SECURITY);
			add(EMPLOYMENT);
			add(HOUSING);
		}
	};

	public static final IsAnswer STRONGLY_DISAGREE = new Answer(-2);
	public static final IsAnswer DISAGREE = new Answer(-1);
	public static final IsAnswer NEUTRAL = new Answer(0);
	public static final IsAnswer AGREE = new Answer(1);
	public static final IsAnswer STRONGLY_AGREE = new Answer(2);

	private static final List<IsAnswer> availableAnswers = new ArrayList<IsAnswer>() {
		{
			add(STRONGLY_DISAGREE);
			add(DISAGREE);
			add(NEUTRAL);
			add(AGREE);
			add(STRONGLY_AGREE);
		}
	};

	public static List<IsQuestion> getAvailableQuestions() {
		return availableQuestions;
	}

	public static List<IsAnswer> getAvailableAnswers() {
		return availableAnswers;
	}

	public static final QuestionnaireResult CDA = new QuestionnaireResult("CDA", new HashMap<IsQuestion, IsAnswer>() {
		{
			put(IMMIGRATION, AGREE);
			put(EDUCATION, STRONGLY_AGREE);
			put(SOCIAL_SECURITY, STRONGLY_DISAGREE);
			put(EMPLOYMENT, NEUTRAL);
			put(HOUSING, STRONGLY_DISAGREE);
		}
	});

	public static final QuestionnaireResult GL = new QuestionnaireResult("GL", new HashMap<IsQuestion, IsAnswer>() {
		{
			put(IMMIGRATION, DISAGREE);
			put(EDUCATION, AGREE);
			put(SOCIAL_SECURITY, STRONGLY_AGREE);
			put(EMPLOYMENT, NEUTRAL);
			put(HOUSING, STRONGLY_AGREE);
		}
	});

	public static final QuestionnaireResult SP = new QuestionnaireResult("SP", new HashMap<IsQuestion, IsAnswer>() {
		{
			put(IMMIGRATION, DISAGREE);
			put(EDUCATION, STRONGLY_AGREE);
			put(SOCIAL_SECURITY, DISAGREE);
			put(EMPLOYMENT, STRONGLY_DISAGREE);
			put(HOUSING, STRONGLY_AGREE);
		}
	});

	public static final QuestionnaireResult VVD = new QuestionnaireResult("VVD", new HashMap<IsQuestion, IsAnswer>() {
		{
			put(IMMIGRATION, AGREE);
			put(EDUCATION, DISAGREE);
			put(SOCIAL_SECURITY, STRONGLY_DISAGREE);
			put(EMPLOYMENT, STRONGLY_AGREE);
			put(HOUSING, STRONGLY_DISAGREE);
		}
	});

	public static final QuestionnaireResult D66 = new QuestionnaireResult("D66", new HashMap<IsQuestion, IsAnswer>() {
		{
			put(IMMIGRATION, DISAGREE);
			put(EDUCATION, NEUTRAL);
			put(SOCIAL_SECURITY, NEUTRAL);
			put(EMPLOYMENT, STRONGLY_AGREE);
			put(HOUSING, STRONGLY_AGREE);
		}
	});

	public static final QuestionnaireResult PVV = new QuestionnaireResult("PVV", new HashMap<IsQuestion, IsAnswer>() {
		{
			put(IMMIGRATION, STRONGLY_AGREE);
			put(EDUCATION, DISAGREE);
			put(SOCIAL_SECURITY, STRONGLY_DISAGREE);
			put(EMPLOYMENT, AGREE);
			put(HOUSING, STRONGLY_DISAGREE);
		}
	});

	public static final QuestionnaireResult PVDA = new QuestionnaireResult("PVDA", new HashMap<IsQuestion, IsAnswer>() {
		{
			put(IMMIGRATION, AGREE);
			put(EDUCATION, STRONGLY_AGREE);
			put(SOCIAL_SECURITY, AGREE);
			put(EMPLOYMENT, STRONGLY_DISAGREE);
			put(HOUSING, AGREE);
		}
	});

	public static final QuestionnaireResult CU = new QuestionnaireResult("CU", new HashMap<IsQuestion, IsAnswer>() {
		{
			put(IMMIGRATION, AGREE);
			put(EDUCATION, STRONGLY_AGREE);
			put(SOCIAL_SECURITY, AGREE);
			put(EMPLOYMENT, DISAGREE);
			put(HOUSING, AGREE);
		}
	});

	public static final QuestionnaireResult SGP = new QuestionnaireResult("SGP", new HashMap<IsQuestion, IsAnswer>() {
		{
			put(IMMIGRATION, AGREE);
			put(EDUCATION, AGREE);
			put(SOCIAL_SECURITY, AGREE);
			put(EMPLOYMENT, AGREE);
			put(HOUSING, AGREE);
		}
	});
}
